<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/graphicsview/qgraphicsitem.cpp -->
<head>
  <title>Qt 4.3: QGraphicsEllipseItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QGraphicsEllipseItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QGraphicsEllipseItem class provides an ellipse item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsEllipseItem&gt;</pre><p>Inherits <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qgraphicsellipseitem-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qgraphicsellipseitem.html#QGraphicsEllipseItem">QGraphicsEllipseItem</a></b> ( QGraphicsItem * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicsellipseitem.html#QGraphicsEllipseItem-2">QGraphicsEllipseItem</a></b> ( const QRectF &amp; <i>rect</i>, QGraphicsItem * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicsellipseitem.html#QGraphicsEllipseItem-3">QGraphicsEllipseItem</a></b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>, QGraphicsItem * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicsellipseitem.html#dtor.QGraphicsEllipseItem">~QGraphicsEllipseItem</a></b> ()</li>
<li><div class="fn"/>QRectF <b><a href="qgraphicsellipseitem.html#rect">rect</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qgraphicsellipseitem.html#setRect">setRect</a></b> ( const QRectF &amp; <i>rect</i> )</li>
<li><div class="fn"/>void <b><a href="qgraphicsellipseitem.html#setRect-2">setRect</a></b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i> )</li>
<li><div class="fn"/>void <b><a href="qgraphicsellipseitem.html#setSpanAngle">setSpanAngle</a></b> ( int <i>angle</i> )</li>
<li><div class="fn"/>void <b><a href="qgraphicsellipseitem.html#setStartAngle">setStartAngle</a></b> ( int <i>angle</i> )</li>
<li><div class="fn"/>int <b><a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a></b> () const</li>
<li><div class="fn"/>int <b><a href="qgraphicsellipseitem.html#startAngle">startAngle</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>4 public functions inherited from <a href="qabstractgraphicsshapeitem.html#public-functions">QAbstractGraphicsShapeItem</a></li>
<li><div class="fn"/>114 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 static public member inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"/>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QGraphicsEllipseItem class provides an ellipse item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>QGraphicsEllipseItem respresents an ellipse with a fill and an outline, and you can also use it for ellipse segments (see <a href="qgraphicsellipseitem.html#startAngle">startAngle</a>(), <a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a>()).</p>
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/graphicsview-ellipseitem.png" /></td><td><img src="images/graphicsview-ellipseitem-pie.png" /></td></tr>
</table></p>
<p>To set the item's ellipse, pass a <a href="qrectf.html">QRectF</a> to QGraphicsEllipseItem's constructor, or call <a href="qgraphicsellipseitem.html#setRect">setRect</a>(). The <a href="qgraphicsellipseitem.html#rect">rect</a>() function returns the current ellipse geometry.</p>
<p>QGraphicsEllipseItem uses the rect and the pen width to provide a reasonable implementation of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#contains">contains</a>(). The <a href="qgraphicsitem.html#paint">paint</a>() function draws the ellipse using the item's associated pen and brush, which you can set by calling <a href="qabstractgraphicsshapeitem.html#setPen">setPen</a>() and <a href="qabstractgraphicsshapeitem.html#setBrush">setBrush</a>().</p>
<p>See also <a href="qgraphicspathitem.html">QGraphicsPathItem</a>, <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>, <a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>, <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>, and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QGraphicsEllipseItem"></a>QGraphicsEllipseItem::QGraphicsEllipseItem ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>. <i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsEllipseItem-2"></a>QGraphicsEllipseItem::QGraphicsEllipseItem ( const <a href="qrectf.html">QRectF</a> &amp; <i>rect</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a> using <i>rect</i> as the default rectangle. <i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsEllipseItem-3"></a>QGraphicsEllipseItem::QGraphicsEllipseItem ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>width</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>height</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a> using the rectangle defined by (<i>x</i>, <i>y</i>) and the given <i>width</i> and <i>height</i>, as the default rectangle. <i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>This function was introduced in Qt 4.3.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>().</p>
<h3 class="fn"><a name="dtor.QGraphicsEllipseItem"></a>QGraphicsEllipseItem::~QGraphicsEllipseItem ()</h3>
<p>Destroys the <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>.</p>
<h3 class="fn"><a name="rect"></a><a href="qrectf.html">QRectF</a> QGraphicsEllipseItem::rect () const</h3>
<p>Returns the item's ellipse geometry as a <a href="qrectf.html">QRectF</a>.</p>
<p>See also <a href="qgraphicsellipseitem.html#setRect">setRect</a>() and <a href="qpainter.html#drawEllipse">QPainter::drawEllipse</a>().</p>
<h3 class="fn"><a name="setRect"></a>void QGraphicsEllipseItem::setRect ( const <a href="qrectf.html">QRectF</a> &amp; <i>rect</i> )</h3>
<p>Sets the item's ellipse geometry to <i>rect</i>. The rectangle's left edge defines the left edge of the ellipse, and the rectangle's top edge describes the top of the ellipse. The height and width of the rectangle describe the height and width of the ellipse.</p>
<p>See also <a href="qgraphicsellipseitem.html#rect">rect</a>() and <a href="qpainter.html#drawEllipse">QPainter::drawEllipse</a>().</p>
<h3 class="fn"><a name="setRect-2"></a>void QGraphicsEllipseItem::setRect ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>width</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>height</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the item's rectangle to the rectangle defined by (<i>x</i>, <i>y</i>) and the given <i>width</i> and <i>height</i>.</p>
<p>This convenience function is equivalent to calling <tt>setRect(QRectF(x, y, width, height))</tt></p>
<p>See also <a href="qgraphicsellipseitem.html#rect">rect</a>().</p>
<h3 class="fn"><a name="setSpanAngle"></a>void QGraphicsEllipseItem::setSpanAngle ( int <i>angle</i> )</h3>
<p>Sets the span angle for an ellipse segment to <i>angle</i>, which is in 16ths of a degree. This angle is used together with <a href="qgraphicsellipseitem.html#startAngle">startAngle</a>() to represent an ellipse segment (a pie). By default, the span angle is 5760 (360 * 16, a full ellipse).</p>
<p>See also <a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a>(), <a href="qgraphicsellipseitem.html#setStartAngle">setStartAngle</a>(), and <a href="qpainter.html#drawPie">QPainter::drawPie</a>().</p>
<h3 class="fn"><a name="setStartAngle"></a>void QGraphicsEllipseItem::setStartAngle ( int <i>angle</i> )</h3>
<p>Sets the start angle for an ellipse segment to <i>angle</i>, which is in 16ths of a degree. This angle is used together with <a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a>() for representing an ellipse segment (a pie). By default, the start angle is 0.</p>
<p>See also <a href="qgraphicsellipseitem.html#startAngle">startAngle</a>(), <a href="qgraphicsellipseitem.html#setSpanAngle">setSpanAngle</a>(), and <a href="qpainter.html#drawPie">QPainter::drawPie</a>().</p>
<h3 class="fn"><a name="spanAngle"></a>int QGraphicsEllipseItem::spanAngle () const</h3>
<p>Returns the span angle of an ellipse segment in 16ths of a degree. This angle is used together with <a href="qgraphicsellipseitem.html#startAngle">startAngle</a>() for representing an ellipse segment (a pie). By default, this function returns 5760 (360 * 16, a full ellipse).</p>
<p>See also <a href="qgraphicsellipseitem.html#setSpanAngle">setSpanAngle</a>() and <a href="qgraphicsellipseitem.html#startAngle">startAngle</a>().</p>
<h3 class="fn"><a name="startAngle"></a>int QGraphicsEllipseItem::startAngle () const</h3>
<p>Returns the start angle for an ellipse segment in 16ths of a degree. This angle is used together with <a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a>() for representing an ellipse segment (a pie). By default, the start angle is 0.</p>
<p>See also <a href="qgraphicsellipseitem.html#setStartAngle">setStartAngle</a>() and <a href="qgraphicsellipseitem.html#spanAngle">spanAngle</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
